import request from "../utils/request.js"

// 登录
export function index(data){
	return request({
		url: `/admin/login`,
		method: 'Post',
		data: data,
	})
}
// 获取当前登录信息
export function getInfo(){
	return request({
		url: `/admin/info`,
		method: 'get',
		data: {},
	})
}

// 首页分组设备
export function listToMiniApp (parameter) {
  return request({
    url: `/iot/iotGroup/listToMiniApp`,
    method: 'get',
    data: parameter
  })
}
// 首页分组设备
export function mapListToMiniAppDetail (id) {
  return request({
    url: `/iot_alarms/iotAlarms/${id}`,
    method: 'get',
  })
}
// 添加分组
export function CreateGroup (parameter) {
  return request({
    url: `/iot/iotGroup/create`,
    method: 'Post',
    data: parameter
  })
}
// 修改分组
export function UpdateGroup (parameter) {
  return request({
    url: `/iot/iotGroup/update`,
    method: 'Post',
    data: parameter
  })
}
///iot/iotGroup/30

//获取设备分组
export function getGroup (id) {
  return request({
    url: `/iot/iotGroup/`+id,
    method: 'Get',
    data: {}
  })
}
// 获取设备分组
export function GroupList (parameter) {
  return request({
    url: `/iot/iotGroup/list`,
    method: 'get',
    data: parameter
  })
}
//添加设备
export function CreateDevice (parameter) {
  return request({
    url: `/iot_alarms/iotAlarms/create`,
    method: 'Post',
    data: parameter
  })
}
//修改会员
export function updateUmsMember (parameter) {
  return request({
    url: `/iot/umsMember/update`,
    method: 'Post',
    data: parameter
  })
}
//添加会员
export function createUmsMember (parameter) {
  return request({
    url: `/iot/umsMember/create`,
    method: 'Post',
    data: parameter
  })
}

//获取会员列表
export function getUmsMemberList (parameter) {
  return request({
    url: `/iot/umsMember/list`,
    method: 'Get',
    data: parameter
  })
}

//获取设备详情
export function getAlarm (id) {
  return request({
    url: `/iot_alarms/iotAlarms/`+id,
    method: 'Get',
    data: {}
  })
}
// 修改设备
export function updateDevice (parameter) {
  return request({
    url: '/iot/iotAlarmParamPushRecord/create',
    method: 'post',
    data: parameter
  })
}
// 删除设备
export function delDevice (id) {
  return request({
    url: '/iot_alarms/iotAlarms/delete/'+id,
    method: 'post',
    data: {
		
	}
  })
}
// 曲线统计
export function miniAppCurveStat (parameter) {
  return request({
    url: '/iot/alarmDataStat/miniAppCurveStat',
    method: 'get',
    data: parameter
  })
}

// 获取会员信息
export function getumsMember (id) {
  return request({
    url: '/iot/umsMember/'+id,
    method: 'get',
    data: {}
  })
}


